package com.lcf.app.thymeleaf.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @author ChenFei
 * @date 2021/10/27
 */
@Controller
public class IndexController {

    @RequestMapping("toIndexPage")
    public String toIndexPage(Model model, HttpServletRequest request, HttpSession session) {
        model.addAttribute("model", "我是model中的值。");
        request.setAttribute("request", "我是request中的值。");
        session.setAttribute("session", "我是session中的值。");
        return "index";
    }

}
